package 补充.多线程;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

public class 线程池 {
    public static void main(String[] args) {
        ExecutorService es= Executors.newFixedThreadPool(10);
        Runnable r1=new Runnable() {
            public void run() {
                for(int i=1;i<=10;i++) {
                    System.out.println(Thread.currentThread().getName()+":"+i);
                }
            }
        };
        es.submit(r1);
        es.submit(r1);
        es.shutdown();

    }
}
